import requests
import re

def getList():
    url = "https://cache.video.iqiyi.com/dash" \
          "?tvid=8169758347687500" \
          "&bid=300" \
          "&vid=6a5a0633528b7d08798abc5b336efb3e" \
          "&src=01010031010000000000" \
          "&vt=0" \
          "&rs=1" \
          "&uid=1273857213" \
          "&ori=pcw" \
          "&ps=0" \
          "&k_uid=fd4185f55030326d56b8a9ea01010bc9" \
          "&pt=0" \
          "&d=0" \
          "&s=" \
          "&lid=" \
          "&cf=" \
          "&ct=" \
          "&authKey=522ca8ec17011ae3cd6ef34a801dcf7f" \
          "&k_tag=1" \
          "&ost=0" \
          "&ppt=0" \
          "&dfp=a1928959435f7d470a85c9acddb8eae9dc8a6aa6431a2fb93384f29a60e1a50ed0" \
          "&locale=zh_cn" \
          "&prio=%7B%22ff%22%3A%22f4v%22%2C%22code%22%3A2%7D" \
          "&pck=4626m1ruYn1x8APVczBbHUvDm2vm1m3DAm1NhHBwm1b1dQS8q40zoHrCiBNrBsm1y7qWcTRkt9c" \
          "&k_err_retries=0" \
          "&up=" \
          "&qd_v=2" \
          "&tm=1635390881032" \
          "&qdy=a" \
          "&qds=0" \
          "&k_ft1=706436220846084" \
          "&k_ft4=1162183859249156" \
          "&k_ft5=262145" \
          "&bop=%7B%22version%22%3A%2210.0%22%2C%22dfp%22%3A%22a1928959435f7d470a85c9acddb8eae9dc8a6aa6431a2fb93384f29a60e1a50ed0%22%7D" \
          "&ut=0" \
          "&vf=85501aa1a92edcf21dab1daec056bc88"

    r = requests.get(url)
    r.raise_for_status()
    print(r.text)

# authKey 29e1d1d9956f10d7c78dbde63fb065aa 522ca8ec17011ae3cd6ef34a801dcf7f
# tm 1635390617742 1635390881032
# vf 8be91419247bedefcf31c74a70fc7f45 85501aa1a92edcf21dab1daec056bc88


# ost: 0
# ppt: "0"
# switchvd: false
# tryCount: 0
# tvid: 8169758347687500
# ugcAuthKey: ""
# vd: 300
# vid: "6a5a0633528b7d08798abc5b336efb3e"



getList()



def zz():
    url = "https://www.iqiyi.com/v_29mchzuik9s.html?vfrm=pcw_home&vfrmblk=O&vfrmrst=711219_home_dianshiju_float_pic_play2"
    r = requests.get(url)
    r.raise_for_status()
    print(r.text)


# zz()


def getpre():
    url = "https://www.iqiyi.com/v_29mchzuik9s.html?vfrm=pcw_home&vfrmblk=O&vfrmrst=711219_home_dianshiju_float_pic_play2"
    headers = {
        "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36"

    }
    r = requests.get(url, headers=headers)
    r.raise_for_status()
    res= r.text
    # print(res)
    s=re.search("var param = \{\};([\s\S]*) param\[\'isSupportAI",res).group()
    print(s)


# getpre()